package com.by.controller;


import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RefreshScope
public class BController {
    @Autowired
    RestTemplate restTemplate;
    @GetMapping("/api/b")
    public String test(){
        //http://192.168.11.66:8080/api/a
        String str = restTemplate.getForObject("http://nacos-a/api/a", String.class);
        return  str;
    }
}